useFixture(default)

def test():
	from Modules import commonBits
	java_recorded_version = '1.6.0_0'

	if window('Protocol Buffer Editor'):
		select('FileChooser', commonBits.sampleDir() + 'protoStoreSales3.bin')
		click('Edit1')
##		select('JTreeTable', '')
		rightclick('JTreeTable', 'Tree,0')
		select_menu('Edit Record')
		select('Table', 'Store: 20 a', 'Data,1')
		select('Table', 'cell:Data,0(20)')
		assert_p('Table', 'Content', '[[store, 1, , 20, 20], [name, 2, , Store: 20 a, Store: 20 a]]')
		click('Down')
		assert_p('Table', 'Content', '[[department, 1, , 170, 170], [name, 2, , Department: 170, Department: 170]]')
		select('Table', 'Department: 170 a', 'Data,1')
		select('Table', 'cell:Data,0(170)')
		assert_p('Table', 'Content', '[[department, 1, , 170, 170], [name, 2, , Department: 170 a, Department: 170 a]]')
		click('Down')
		assert_p('Table', 'Content', '[[keycode, 1, , 63604808, 63604808], [saleDate, 2, , 40118, 40118], [quantity, 3, , 1, 1], [price, 4, , 4870, 4870]]')
		select('Table', '20040118', 'Data,1')
##		select('Table', '63604808a', 'Data,0')
##		select('Table', 'cell:Data,0(63604808)')

##		if window('Conversion Error'):
##			click('Cancel')
##		close()

		select('Table', 'cell:Data,2(1)')
		click('Right')
		assert_p('Table', 'Content', '[[quantity, 1, , 1, 1], [price, 2, , 4870, 4870], [count, 3, , 1, 1]]')
		select('Table', '11', 'Data,2')
		select('Table', 'cell:Data,1(4870)')
		assert_p('Table', 'Content', '[[quantity, 1, , 1, 1], [price, 2, , 4870, 4870], [count, 3, , 11, 11]]')
		click('Up')
		click('Right')
		click('Down')
		click('Right')
		select('Table', '-10', 'Data,2')
		select('Table', '-190000', 'Data,3')
		select('Table', 'cell:Data,1(40118)')
		click('Right')
		click('Right')
		select('Table', '20040118', 'Data,1')
		select('Table', 'cell:Data,2(1)')
		click('BasicInternalFrameTitlePane$NoFocusButton2')
		select_menu('Window>>protoStoreSales3.bin>>Tree View')
##		select('JTreeTable', '')
		rightclick('JTreeTable', 'Tree,2')
		select_menu('Edit Record')
		select('Table', 'Store: 166 a', 'Data,1')
		select('Table', 'cell:Data,0(166)')
		assert_p('Table', 'Content', '[[store, 1, , 166, 166], [name, 2, , Store: 166 a, Store: 166 a]]')
		click('Down')
		click('Right')
		click('Right')
		select('Table', 'Department: 170 a', 'Data,1')
		select('Table', 'cell:Data,0(170)')
		assert_p('Table', 'Content', '[[department, 1, , 170, 170], [name, 2, , Department: 170 a, Department: 170 a]]')
		select_menu('Utilities>>Compare with Disk')
		assert_p('Table', 'Content', '[[, Old, 1, 20, Store: 20, , ], [, New, 1, , Store: 20 a, , ], [, Old, 2, 170, Department: 170, , ], [, New, 2, , Department: 170 a, , ], [, Old, 3, 63604808, 40118, 1, 4870], [, New, 3, , 20040118, , ], [, Old, 4, 1, 4870, 1, ], [, New, 4, , , 11, ], [, Old, 7, 69684558, 40118, -1, -19000], [, New, 7, , , -10, -190000], [, Old, 9, 69694158, 40118, 1, 19000], [, New, 9, , 20040118, , ], [, Old, 70, 166, Store: 166, , ], [, New, 70, , Store: 166 a, , ], [, Old, 82, 170, Department: 170, , ], [, New, 82, , Department: 170 a, , ]]')
		click('BasicInternalFrameTitlePane$NoFocusButton2')
		select_menu('Window>>protoStoreSales3.bin>>Record: ')
		click('BasicInternalFrameTitlePane$NoFocusButton2')
		select_menu('Window>>protoStoreSales3.bin>>Tree View')
		select_menu('File>>Export')
		select('FileChooser', commonBits.sampleDir() + 'protoStoreSales3_Compare3.bin')
		click('Save File')

	close()
